package com.janella.web.beans;

import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlInputText;
import javax.faces.event.ActionEvent;

public class TestBean {
	
	private UIComponent comp;
	
	public UIComponent getComp() {
		return comp;
	}

	public void setComp(UIComponent comp) {
		this.comp = comp;
	}

	private String message;
	
	private String welcomeMessage;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getWelcomeMessage() {
		return welcomeMessage;
	}

	public void setWelcomeMessage(String welcomeMessage) {
		this.welcomeMessage = welcomeMessage;
	}
	
	public String welcome(){
		welcomeMessage = "Welcome! " + message;
		return "ok";
	}
	
	public void listen(ActionEvent event){
		HtmlInputText t = (HtmlInputText)comp;
		t.setValue("Help me!!!!");
	}
}
